#include <string>
#include <fstream>

#include "colors.hpp"

#ifndef _FILE_ENCRYPTOR_DECRYPTOR_HPP_
#define _FILE_ENCRYPTOR_DECRYPTOR_HPP_

namespace alexcr4ckpentest
{
  class FileEncryptorDecryptor final
  {
  public:
    enum class mode_t : uint8_t
    {
      encrypt,
      dectrypt
    };

    FileEncryptorDecryptor() = default;
    ~FileEncryptorDecryptor() = default;
    FileEncryptorDecryptor(const std::string& target_filename);

    FileEncryptorDecryptor(const FileEncryptorDecryptor&) = delete;
    FileEncryptorDecryptor(FileEncryptorDecryptor&&) = delete;
    FileEncryptorDecryptor& operator=(const FileEncryptorDecryptor&) = delete;
    FileEncryptorDecryptor& operator=(FileEncryptorDecryptor&&) = delete;

    void set_target_file(const std::string& target_filename);
    void process_data(uint64_t base_key, uint32_t salt_key, mode_t mode);

  private:
    std::string m_target_file_name;
    std::fstream m_file_stream;
  };
} // namespace alex

#endif // _FILE_ENCRYPTOR_DECRYPTOR_HPP_
